<h1><?php echo $this->t->_('Search') ?></h1>
<form action="<?php echo SITE_URL . PAGE_URL ?>" method="post" accept-charset="utf-8">
    <div id="searchbox">
        <div id="input">
            <input type="text" class="text" maxlength="50" name="search" value="" />
        </div>
        <div id="btn">
            <button type="submit"><?php echo $this->t->_('Search') ?></button>
        </div>
        <div class="clear"></div>
    </div>
</form>


<?php
if (isset($this->error)) {
    if ($this->error == 0) {
        echo '';
    }
    if ($this->error == 1) {
        echo '<h3>По вашему запросу ничего не найдено</h3>';
    }
} else {
    $pages = $this->pages;
    $model = new SearchModel();
    echo '<h3>По запросу &laquo;' . $this->query . '&raquo; найдено:</h3>';
    foreach ($this->results as $key => $val) {
        $page = $this->pages[$key];
        echo '<a href="' . SITE_URL . $val['page_url'] . '">' . $page->name . '</a><br />';
        echo ($val['content'] . '<br /><br />');
    }
}
?>
